package gttp.nspa.server.adm.rpc;

import gttp.nspa.client.adm.rpc.IDictService;
import gttp.nspa.server.dao.DAJ;
import gttp.nspa.server.dao.DAJs;
import gttp.nspa.shared.om.Employee;
import gttp.nspa.shared.om.Locker;
import gttp.nspa.shared.om.Massa;

import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class DictService extends RemoteServiceServlet implements IDictService {

    private static final long   serialVersionUID = 1L;

    private final DAJ<Massa>    masDAJ           = DAJs.massa;
    private final DAJ<Locker>   lckDAJ           = DAJs.locker;
    private final DAJ<Employee> casDAJ           = DAJs.cashier;
    private final DAJ<Employee> theDAJ           = DAJs.therapist;

    public Locker getLocker(String code) {
        return lckDAJ.get(code);
    }

    public List<Locker> listLocker() {
        return lckDAJ.list();
    }

    public Massa getMassa(String code) {
        return masDAJ.get(code);
    }

    public List<Massa> listMassa() {
        return masDAJ.list();
    }

    public Employee getCashier(String code) {
        return casDAJ.get(code);
    }

    public List<Employee> listCashier() {
        return casDAJ.list();
    }

    public Employee getTherapist(String code) {
        return theDAJ.get(code);
    }

    public List<Employee> listTherapist() {
        return theDAJ.list();
    }

}
